/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.ac.aptech.fat1.c0910g.dao;

import java.util.ArrayList;
import vn.ac.aptech.fat1.c0910g.entity.Food;
import vn.ac.aptech.fat1.c0910g.entity.Menu;

/**
 *
 * @author NDC
 */
public interface MenuDAO {
     /**
     *  List all menu from database.
     *  @return the list of Menu.
     *  Return null if no Menu found
     *  @throws Throws Exception if have any error.
     */
    public ArrayList<Menu> listMenu() throws Exception;
    /**
     *  Add new menu to database. Add all foods have in menu if existed
     *  @param m the object contain all information of menu.
     *  @return true if add successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean addMenu(Menu m) throws Exception;

    /**
     *  Update menu information to database.
     *  @param m the object contain all information of menu. (Must have older ID)
     *  @return true if add successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean updateMenu(Menu m) throws Exception;

    /**
     *  Delete menu.
     *  @param m the Menu object (must have ID).
     *  @return true if delete successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean deleteMenu(Menu m) throws Exception;

    /**
     *  Get menu
     *  @param mid the ID of menu
     *  @return the object menu have information.Return null if no Menu found
     *  @throws Throws Exception if have any error.
     */
    public Menu getMenuById(int mid) throws Exception;
    /**
     *  Add new food to menu which have menu ID
     *  @param m the object contain information of menu (must have ID).
     *  @param f the object contain information of food (must have ID).
     *  @return true if add successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean addFoodToMenu(Menu m, Food f) throws Exception;

    /**
     *  Remove food from menu which have menu ID
     *  @param m the object contain information of menu (must have ID).
     *  @param f the object contain information of food (must have ID).
     *  @return true if remove successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean removeFoodFromMenu(Menu m, Food f) throws Exception;

    /**
     *  Check food is existed in menu
     *  @param m the object contain information of menu (must have ID).
     *  @param f the object contain information of food (must have ID).
     *  @return true if menu have food in list
     *  @throws Throws Exception if have any error.
     */
    public boolean checkFood(Menu m, Food f) throws Exception;
}
